package com.baizhi.cmfz.appcontroller;

import com.baizhi.cmfz.entity.Album;
import com.baizhi.cmfz.service.AlbumService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/album")
public class AlbumAppController {

	@Resource
	private AlbumService albumService;

	@GetMapping("/selectAlbum/{limit}")
	public List<Album> selectAlbum(@PathVariable("limit") int limit){
		return albumService.selectAlbum(limit);
	}


	@GetMapping("/selectById/{albumId}")
	public Album selectById(@PathVariable("albumId") int albumId){
		return albumService.selectById(albumId);
	}
}
